<?php

namespace Xrfg\Api\Trading\Account\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class TransferRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules = [
            'transfer_number' => ['required', 'integer', 'min:1'],
            'pay_password' => ['required', 'payPassword'],
        ];

        return $rules;
    }

    public function messages()
    {
        return [
            'transfer_number.required' => __('划转数量必填'),
            'transfer_number.integer' => __('划转数量必须整数'),
            'transfer_number.min' => __('划转数量最低1')
        ];
    }
}
